package cn.edu.fudan.test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CopyNegative {
	public static void main(String[] args) throws IOException{
		
		String path = "D:\\DataReader\\DZ2RE\\";
		
		BufferedReader bf = new BufferedReader(new FileReader("D:\\DataReader\\positiveclass\\note.txt"));
		List<Integer> positive = new ArrayList<>();
		String s = bf.readLine();
		while(s!=null){
			positive.add(Integer.parseInt(s));
			s = bf.readLine();
		}
		bf.close();
		
		for(int i = 1; i <= 15440; i ++){
			
			System.out.println(i);
			
			String filePath = path + i;
			if(positive.contains(i)){
				continue;
			}
			try{
				bf = new BufferedReader(new FileReader(filePath));
				List<String> temp = new ArrayList<>();
				s = bf.readLine();
				while(s != null){
					temp.add(s);
					s = bf.readLine();
				}
				bf.close();
				FileWriter fWriter = new FileWriter("D:\\DataReader\\negativeclass\\"+i);
				for(String para : temp){
					fWriter.write(para+"\r\n");
				}
				fWriter.close();
			}catch(Exception e){
				
			}			
		}
	}
}
